package iscript.coreFramework.data 
{
	import flash.utils.Dictionary;
	import iscript.coreFramework.util.DictionaryUtil;
	
	/**
	 * ...
	 * @author raymond
	 */
	public class ObjectPool 
	{
		
		public function ObjectPool() 
		{
			
		}
		
		static private var  _pool:Dictionary = new Dictionary();
		static  public  function add(name:*, target:Object):void {
			    _pool[name] = target;
			}
		
		static  public  function getObject(name:*):Object {
			    if (!DictionaryUtil.hasKey(_pool, name)) return null;
			    return _pool[name];
			}
		 
		static  public  function hasObject(name:*):Boolean {
			    return DictionaryUtil.hasKey(_pool, name);
			}	
			
		static  public  function remove(name:*):void {
			    delete _pool[name];
			}
		
	}

}